package com.ks.core.framework.cpsupload.demos.pay;

// 8. 策略工厂
public class PaymentFactory {
    public static PaymentStrategy createStrategy(PaymentChannel channel) {
        switch (channel) {
            case WECHAT:
                return new WechatPaymentStrategy();
            case ALIPAY:
                return new AlipayPaymentStrategy();
            case UNIONPAY:
                return new UnionpayPaymentStrategy();
            default:
                throw new IllegalArgumentException("不支持的支付渠道");
        }
    }
}